<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
	<title>listusers</title>
    <link rel="stylesheet" type="text/css" href="./bootstrap-3.3.5-dist/css/bootstrap.min.css">.
</head>
<body>
<?php
require "Admin/View/admin/adminlogin.php";

?>
<h2><a href="admin.php?c=user&m=reguser">用户注册</a></h2>
<center><h2>用户列表 (系统共<?Php echo count($data['users']); ?>名用户)</h2></center>
<div class="col-md-2"></div>
<div class="col-md-8">
<form class="navbar-form navbar-left" role="search" action="admin.php?c=user&m=searchuser" method="post" name="key" id="key" align="left" >
          <div class="form-group">
          <input name="key" type="text"  class="form-control" placeholder="请输入用户名称" id="key" >
          </div>
          <button type="submit" class="btn btn-default">Submit</button>
        </form>
<table class="table table-hover">
    <tr>
        <th>用户编号</th>
        <th>姓名</th>
        <th>性别</th>
        <th>生日</th>
        <th>爱好</th>
        <th>学历</th>
        <th>头像</th>
        <th>操作</th>
    </tr>
    <?php
    foreach ($data['users'] as $row) {
    ?>
    <tr>
    <td><?php echo $row['uid'];?></td>
    <td><?php echo $row['uname'];?></td>
    <td>
    <?php if($row['gender']==0)
           echo"男";
           else
           echo"女";
    ?>
    </td>
    <td><?php echo $row['birthdate'];?></td>
    <td><?php echo $row['hobby'];?></td>
    <td>
    <?php
    switch ($row['degree']) {
        case '1':
            echo"高中";
            break;
            case '2':
            echo"大学";
            break;
            case '3':
            echo"研究生";
            break;
            case '4':
            echo"博士生";
            break;
        
        default:
            echo "为选择学历";
            break;
    }
    ?>
    </td>
    <td><img src="./posters/<?php echo $row['pic'];?>" width="80" hight="80" alt="头像" title="<?php echo $row['intro'];?>">
    </td>
    <td><a href="admin.php?c=user&m=edituser&uid=<?php echo $row['uid'];?>">修改</a>
        <a href="admin.php?c=user&m=deluser&uid=<?php echo $row['uid'];?>">删除</a>
    </td>
    </tr>
    <?php
      }  
    ?>
</table>
</div>
<?php  
//var_dump($data['users']);//显示数组信息
?>
</body>
</html>